#include<iostream>
#include<string>
using namespace std;

/*先声明一个类，父类*/
class Animals
{
    public:
        string color;
        int weight;
};

/*再声明一个子类，来继承上面的父类*/
class Dog:public Animals
{
    public :
        string name;
        int age;
        void run(){
            cout << "狗狗信息："<<endl;
        }
};

int main()
{
    Dog dog;
    dog.name = "旺财";
    dog.age = 6;
    dog.color = "white";
    dog.weight = 1;
    dog.run();

    cout << "名字" << dog.name << endl;
    cout << "年龄" <<dog.age << endl;
    cout << "颜色" <<dog.color << endl;
    cout << "体重" <<dog.weight << endl;
    return 0;

}